const path = require("path");
const rootPath = require("../utils/rootPath");

const config = require(path.join(rootPath, './config/', process.env.config + '.config.js'));

const options = {...config};

[
  'multiProcess',
  'files',
  'root',
  'includes',
  'ignoreFiles',
  'filterFiles',
  'dealFn',
  'after',
  'logger'
].forEach(key => delete options?.[key])

process.on('message', arg => {
  config.dealFn(arg, options, msg => {
    process.send(msg);
  })
})
